package com.design.mode.oop;

import org.junit.jupiter.api.Test;

import java.math.BigDecimal;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-04-08 11:20:18
 */
public class OTest {

    @Test
    public void test1() {
        BigDecimal zero = BigDecimal.ZERO;
        BigDecimal bd = BigDecimal.valueOf(0);
        System.out.println("zero = " + zero);
        System.out.println("bd.equals(zero) = " + bd.equals(zero));
    }

    @Test
    public void test2() {
        BigDecimal zero = BigDecimal.ZERO;
        BigDecimal bd = BigDecimal.valueOf(-1.00);
        System.out.println("zero = " + zero);
        System.out.println("bd.compareTo(zero) = " + bd.compareTo(zero));
    }
}
